Imports System
Imports System.Data
Imports System.Data.Common
Imports System.Collections.Generic
Imports ACFramework

<Serializable()> _
Public Class ACEEntidad

#Region " Campos "
   Private m_entc_codigo As String
   Private m_entc_razonsoc As String
   Private m_entc_dociden As String
   Private m_entc_tipdociden As String
   Private m_tipo_codtdi As String
   Private m_tipo_tabtdi As String
   Private m_nuevo As Boolean
   Private m_modificado As Boolean
   Private m_eliminado As Boolean
#End Region

#Region " Constructores "
   Public Sub New()

   End Sub
#End Region

#Region " Propiedades "
   Public Property ENTC_Codigo() As String
      Get
         Return m_entc_codigo
      End Get
      Set(ByVal value As String)
         If Not IsNothing(m_entc_codigo) Then
            If Not m_entc_codigo.Equals(value) Then
               m_entc_codigo = value
               OnENTC_CodigoChanged(m_entc_codigo, EventArgs.Empty)
            End If
         Else
            m_entc_codigo = value
            OnENTC_CodigoChanged(m_entc_codigo, EventArgs.Empty)
         End If
      End Set
   End Property
   Public Property ENTC_RazonSoc() As String
      Get
         Return m_entc_razonsoc
      End Get
      Set(ByVal value As String)
         If Not IsNothing(m_entc_razonsoc) Then
            If Not m_entc_razonsoc.Equals(value) Then
               m_entc_razonsoc = value
               OnENTC_RazonSocChanged(m_entc_razonsoc, EventArgs.Empty)
            End If
         Else
            m_entc_razonsoc = value
            OnENTC_RazonSocChanged(m_entc_razonsoc, EventArgs.Empty)
         End If
      End Set
   End Property
   Public Property ENTC_DocIden() As String
      Get
         Return m_entc_dociden
      End Get
      Set(ByVal value As String)
         If Not IsNothing(m_entc_dociden) Then
            If Not m_entc_dociden.Equals(value) Then
               m_entc_dociden = value
               OnENTC_DocIdenChanged(m_entc_dociden, EventArgs.Empty)
            End If
         Else
            m_entc_dociden = value
            OnENTC_DocIdenChanged(m_entc_dociden, EventArgs.Empty)
         End If
      End Set
   End Property
   Public Property ENTC_TipDocIden() As String
      Get
         Return m_entc_tipdociden
      End Get
      Set(ByVal value As String)
         If Not IsNothing(m_entc_tipdociden) Then
            If Not m_entc_tipdociden.Equals(value) Then
               m_entc_tipdociden = value
               OnENTC_TipDocIdenChanged(m_entc_tipdociden, EventArgs.Empty)
            End If
         Else
            m_entc_tipdociden = value
            OnENTC_TipDocIdenChanged(m_entc_tipdociden, EventArgs.Empty)
         End If
      End Set
   End Property
   Public Property TIPO_CodTDI() As String
      Get
         Return m_tipo_codtdi
      End Get
      Set(ByVal value As String)
         If Not IsNothing(m_tipo_codtdi) Then
            If Not m_tipo_codtdi.Equals(value) Then
               m_tipo_codtdi = value
               OnTIPO_CodTDIChanged(m_tipo_codtdi, EventArgs.Empty)
            End If
         Else
            m_tipo_codtdi = value
            OnTIPO_CodTDIChanged(m_tipo_codtdi, EventArgs.Empty)
         End If
      End Set
   End Property
   Public Property TIPO_TabTDI() As String
      Get
         Return m_tipo_tabtdi
      End Get
      Set(ByVal value As String)
         If Not IsNothing(m_tipo_tabtdi) Then
            If Not m_tipo_tabtdi.Equals(value) Then
               m_tipo_tabtdi = value
               OnTIPO_TabTDIChanged(m_tipo_tabtdi, EventArgs.Empty)
            End If
         Else
            m_tipo_tabtdi = value
            OnTIPO_TabTDIChanged(m_tipo_tabtdi, EventArgs.Empty)
         End If
      End Set
   End Property
   Public ReadOnly Property Nuevo() As Boolean
      Get
         Return m_nuevo
      End Get
   End Property
   Public ReadOnly Property Modificado() As Boolean
      Get
         Return m_modificado
      End Get
   End Property
   Public ReadOnly Property Eliminado() As Boolean
      Get
         Return m_eliminado
      End Get
   End Property
#End Region

#Region " Eventos "
   Public Event ENTC_CodigoChanged As EventHandler
   Public Event ENTC_RazonSocChanged As EventHandler
   Public Event ENTC_DocIdenChanged As EventHandler
   Public Event ENTC_TipDocIdenChanged As EventHandler
   Public Event TIPO_CodTDIChanged As EventHandler
   Public Event TIPO_TabTDIChanged As EventHandler
   Public Sub OnENTC_CodigoChanged(ByVal sender As Object, ByVal e As EventArgs)
      ActualizarInstancia()
      RaiseEvent ENTC_CodigoChanged(sender, e)
   End Sub
   Public Sub OnENTC_RazonSocChanged(ByVal sender As Object, ByVal e As EventArgs)
      ActualizarInstancia()
      RaiseEvent ENTC_RazonSocChanged(sender, e)
   End Sub
   Public Sub OnENTC_DocIdenChanged(ByVal sender As Object, ByVal e As EventArgs)
      ActualizarInstancia()
      RaiseEvent ENTC_DocIdenChanged(sender, e)
   End Sub
   Public Sub OnENTC_TipDocIdenChanged(ByVal sender As Object, ByVal e As EventArgs)
      ActualizarInstancia()
      RaiseEvent ENTC_TipDocIdenChanged(sender, e)
   End Sub
   Public Sub OnTIPO_CodTDIChanged(ByVal sender As Object, ByVal e As EventArgs)
      ActualizarInstancia()
      RaiseEvent TIPO_CodTDIChanged(sender, e)
   End Sub
   Public Sub OnTIPO_TabTDIChanged(ByVal sender As Object, ByVal e As EventArgs)
      ActualizarInstancia()
      RaiseEvent TIPO_TabTDIChanged(sender, e)
   End Sub
#End Region

#Region " Metodos "
   'Public Sub Instanciar(ByVal x_instancia As NSEInstancia)
   '   Select Case x_instancia
   '      Case NSEInstancia.Consulta
   '         m_nuevo = False
   '         m_modificado = False
   '         m_eliminado = False
   '      Case NSEInstancia.Nuevo
   '         m_nuevo = True
   '         m_modificado = False
   '         m_eliminado = False
   '      Case NSEInstancia.Modificado
   '         m_nuevo = False
   '         m_modificado = True
   '         m_eliminado = False
   '      Case NSEInstancia.Eliminado
   '         m_nuevo = False
   '         m_modificado = False
   '         m_eliminado = True
   '   End Select
   'End Sub
   Public Sub ActualizarInstancia()
      If Not Nuevo Then
         If Not Eliminado Then
            'Instanciar(NSEInstancia.Modificado)
         End If
      End If
   End Sub
#End Region


End Class
